import Vue from 'vue'
import Router from 'vue-router'

// Containers
import Full from '../views/containers/Full'

// Views - Pages
import Page404 from '../views/Page404'
import Page500 from '../views/Page500'
import Login from '../views/login/Login.vue'
import Register from '../views/Register'

import homeIndex from '../views/home/homeIndex.vue'
import realTimeNews from '../views/realTimeNews/realTimeNews.vue'
import realTimeHotNews from '../views/realTimeHotNews/realTimeHotNews.vue'
import hotAriticalAppreciate from '../views/hotAriticalAppreciate/hotAriticalAppreciate.vue'
import selfMediaLibrary from '../views/selfMediaLibrary/selfMediaLibrary.vue'
import favoriteFolder from '../views/favoriteFolder/favoriteFolder.vue'
import goodContent from '../views/goodContent/goodContent.vue'
import dataCustomization from '../views/dataCustomization/dataCustomization.vue'
import foreignVideo from '../views/foreignVideo/foreignVideo.vue'
import hotWordAnalyze from '../views/hotWordAnalyze/hotWordAnalyze.vue'
import myGpoint from '../views/myGpoint/myGpoint.vue'
import authorMonitored from '../views/authorMonitored/authorMonitored.vue'
import personageCompany from '../views/personageCompany/personageCompany.vue'
import initPage from '../views/initPage.vue'
import questionResponse from '../views/questionResponse/questionResponse.vue'
import qaqHome from '../views/questionResponse/child/homepage.vue'
import qaqRegist from '../views/questionResponse/child/applyForJoin.vue'
import qaqResponseList from '../views/questionResponse/child/responseList.vue'
import qaqSubmitQuestion from '../views/questionResponse/child/submitQuestion.vue'

Vue.use(Router)

export default new Router({
  mode: 'hash', // Demo is living in GitHub.io, so required!
  linkActiveClass: 'open active',
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/',
      redirect: '/login',
      name: 'Home',
      component: Full,
      children: [
        // 首頁
        {
          path: 'homeIndex',
          name: 'homeIndex',
          component: homeIndex
        },
        // 初始頁面
        {
          path: 'initPage',
          name: 'initPage',
          component: initPage
        },
        // 实时资讯
        {
          path: 'realTimeNews',
          name: 'realTimeNews',
          component: realTimeNews
        },
        // 实时热点
        {
          path: 'realTimeHotNews',
          name: 'realTimeHotNews',
          component: realTimeHotNews
        },
        // 爆文赏析
        {
          path: 'hotAriticalAppreciate',
          name: 'hotAriticalAppreciate',
          component: hotAriticalAppreciate
        },
        // 自媒体文库
        {
          path: 'selfMediaLibrary',
          name: 'selfMediaLibrary',
          component: selfMediaLibrary
        },
        // 收藏夹
        {
          path: 'favoriteFolder',
          name: 'favoriteFolder',
          component: favoriteFolder
        },
        // 干货
        {
          path: 'goodContent',
          name: 'goodContent',
          component: goodContent
        },
        // 数据定制
        {
          path: 'dataCustomization',
          name: 'dataCustomization',
          component: dataCustomization
        },
        // 海外视频
        {
          path: 'foreignVideo',
          name: 'foreignVideo',
          component: foreignVideo
        },
        // 热词分析
        {
          path: 'hotWordAnalyze',
          name: 'hotWordAnalyze',
          component: hotWordAnalyze
        },
        // 我的G点
        {
          path: 'myGpoint',
          name: 'myGpoint',
          component: myGpoint
        },
        // 作者监控
        {
          path: 'personageCompany',
          name: 'personageCompany',
          component: personageCompany
        },
        // 作者监控
        {
          path: 'authorMonitored',
          name: 'authorMonitored',
          component: authorMonitored
        },
        {
            path: 'questionResponse',
            name: 'questionResponse',
            component: questionResponse,
            children: [
                {
                    path: 'home',
                    name: 'home',
                    component: qaqHome
                },
                {
                    path: 'regist',
                    name: 'regist',
                    component: qaqRegist
                },
                {
                    path: 'response',
                    name: 'response',
                    component: qaqResponseList
                },
                {
                    path: 'question',
                    name: 'question',
                    component: qaqSubmitQuestion
                },
            ]
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/pages',
      redirect: '/pages/p404',
      name: 'Pages',
      component: {
        render (c) { return c('router-view') }
      },
      children: [
        {
          path: '404',
          name: 'Page404',
          component: Page404
        },
        {
          path: '500',
          name: 'Page500',
          component: Page500
        },
        {
          path: 'register',
          name: 'Register',
          component: Register
        }
      ]
    }
  ]
})
